package com.wang.user.service;

import com.wang.reponse.UpvoteVo;
import com.wang.user.model.Upvote;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* @author bkty0
* @description 针对表【upvote(帖子点赞表)】的数据库操作Service
* @createDate 2025-04-23 10:39:21
*/
public interface UpvoteService extends IService<Upvote> {

    Boolean submit(Upvote upvote);

    Boolean cancel(Upvote upvote);

    /**
     * 根据帖子id集合查询这些帖子的点赞量
     * @param postIds
     * @return
     */
    List<UpvoteVo> postUpvoteCountByPostIds(List<Long> postIds);

    Upvote getByPostIdAndUserId(Long id, Integer uid);
}
